# ***meta charset="UTF-8"***
# @Time: 2021/2/3 22:22
# @Author: 邢光强
# @Email： 1062584918@qq.com
# @File： customer_page.py
# @Project: crm_project

from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from pages.base_page import BasePage

class CostomerPage(BasePage):
    kgtj_locator = (By.XPATH,"/html/body/div[5]/div[1]/ul/li[5]/a")
    kh_search_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[1]/ul/li/form/ul/li[4]/button")
    kh_tjbb_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[2]/ul/li[2]/a")
    kh_lytjt_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[2]/ul/li[3]/a")
    kh_khqktj_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[2]/ul/li[4]/a")
    kh_khhytj_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[2]/ul/li[5]/a")
    kh_department_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[1]/ul/li/form/ul/li[1]/select")
    kh_role_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[1]/ul/li/form/ul/li[2]/select")
    kh_count_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[3]/div[1]/table/tfoot/tr/td[1]")
    kh_khlytj_tool_locator = (By.CLASS_NAME,"highcharts-button")
    kh_khlytj_print_locator = (By.XPATH,"/html/body/div[5]/div[2]/div[3]/div[2]/div/div/div/div/div/div[1]")


    def click_kgtj(self):
        self.find_element(self.kgtj_locator).click()

    def click_kh_search(self):
        self.find_element(self.kh_search_locator).click()

    def click_kh_tjbb(self):
        self.find_element(self.kh_tjbb_locator).click()

    def click_kh_lytjt(self):
        self.find_element(self.kh_lytjt_locator).click()

    def click_kh_khqktj(self):
        self.find_element(self.kh_khqktj_locator).click()

    def click_kh_khhytj(self):
        self.find_element(self.kh_khhytj_locator).click()

    def kh_department_select(self):
        return Select(self.find_element(self.kh_department_locator))

    def kh_role_select(self):
        return Select(self.find_element(self.kh_role_locator))

    def kh_count_text(self):
        return self.find_element(self.kh_count_locator).text

    def kh_khlytj_tool(self):
        self.find_element(self.kh_khlytj_tool_locator).click()

    def kh_khlytj_print(self):
        return self.find_element(self.kh_khlytj_print_locator).text


